/**
 * Created by Administrator on 2016/4/5.
 */
(function ($){
    getWH();
    navbind();
    //动态获取页面和屏幕宽高
    $(window).resize(function () {
        if (getPageSize()[0] < 480) {
            window.resizeTo(document.body.clientWidth, 480);
        } else {
            getWH();
        }
    });

    /*应用angularjs*/
    /*配置angular*/
    var app=angular.module("myapps",[]);
    /*配置控制器*/
    app.controller("getmsginfo",function($scope,$http){
        $scope.getmsg=function (){
            $http.get("/pages/mainlist.do").success(function (data){
                console.log(data);
                var myarr=[];
                for(var i = 0;i<data.length;i++){
                    var mydata = data[i].shop_address.split("-",1);
                    myarr.push(mydata);
                    data[i].shop_address=myarr[i];
                }

                $scope.mymsg=data;
                //console.log(mylist);
            })
        };
        $scope.getthsinfo= function (s) {
            //jQuery(this).children("p").html();
            console.log(s);
            window.location.href="pages/mainDetails.html?title="+s;
            //$http.post("pages/mainDetails.html",{title:s}).success(function (data){
            //
            //});
        }
    });

})(jQuery);


function getWH() {
    var screenWidth = getPageSize()[2];
    var screeenHeight = getPageSize()[3];
    var pageWidth = getPageSize()[0];
    var pageHeight = getPageSize()[1];
//    设置每个模块的高度
    $(".header-back-image").css("height", screenWidth * .7 + "px");
    $(".Thumb-up").css({
        "height": screenWidth * .125 + "px",
        "width": screenWidth * .125 + "px",
        "border-radius": screenWidth * .125 / 2 + "px",
        "top": screenWidth * .7 - screenWidth * .125 / 2 + "px"
    });
    //$(".reason-wrapper").css("height",screenWidth * .2 + "px");
    $(".reason-wrapper p").css({"margin":"4% auto","width":"96%"});


}